package com.chenqi.community.dao;

import com.chenqi.community.entity.Tag;
import org.apache.ibatis.annotations.Param;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author Ardai
 */
@Repository
@MapperScan
public interface TagDao {
    //查找所有的标签
    List<Tag> findAllTags();

    //文章添加标签
    void insertTags(@Param("pid") Integer pid, @Param("tid") Integer tid);

    //根据帖子查找标签
    List<Integer> findTagsByPostId(@Param("pid") Integer pid);

    //根据标签id查找标签
    Tag findTagById(@Param("tid") Integer tid);
}
